<?php $this->load->view('header'); ?>
<?php $this->load->view('cuerpo'); ?>
<div class="formulario">
	<form name="Rrespnsable"
		action="<?php echo base_url(); ?>index.php/responsable/insertar"
		method="post">
		<fieldset>
			<legend>Datos del Responsable</legend>
			<table>
				<tr>
					<td><label>Nombres:</label></td>
					<td><input type="text" name="txtNombres" size="50"
						placeholder="Nombres del Cliente"
						title="Letras y espacios en blanco. NO incluir tildes, el caracter ñ y minusculas"
						pattern="[A-Z ]{2,40}" maxlength="40"
						onkeyup="javascript:this.value=this.value.toUpperCase()" required />
					</td>
				</tr>
				<tr>
					<td><label>Apellidos:</label></td>
					<td><input type="text" name="txtApellidos" size="50"
						placeholder="Apellidos del Cliente"
						title="Letras y espacios en blanco. NO incluir tildes, el caracter ñ y minusculas"
						pattern="[A-Z ]{2,40}" maxlength="40"
						onkeyup="javascript:this.value=this.value.toUpperCase()" required />
					</td>
				</tr>
				<tr>
					<td><label>Fecha de Nacimiento:</label></td>
					<td><input type="date" name="dNacimiento" size="50"
						max="<?php echo date('Y-m-d', strtotime('-18 year'));?>" required /></td>
				</tr>
				<tr>
					<td><label>Dirección:</label></td>
					<td><input type="text" name="txtDireccion" size="50"
						onkeyup="javascript:this.value=this.value.toUpperCase()"
						maxlength="60" pattern="[A-Z0-9ÁÉÍÓÚÑ&Ü /*|°.]{5,60}" required />
					</td>
				</tr>
				<tr>
					<td><label>Correo:</label></td>
					<td><input type="email" name="txtCorreo" size="50"
						placeholder="Ej: example@example.com" maxlength="60"
						required="required" /></td>
				</tr>
				<tr>
					<td><label>Celular:</label></td>
					<td><input type="tel" name="txtCelular" size="50"
						placeholder="Ej: 987654321" pattern="[0-9]{9}" maxlength="9"
						onkeypress="return justNumbers(event)" required="required"></td>
				</tr>
				<tr>
					<td><label>Teléfono</label></td>
					<td><input type="tel" name="txtTelefono" size="50"
						placeholder="Ej: 2365478" pattern="[0-9]{7}" maxlength="7"
						onkeypress="return justNumbers(event)" required="required" /></td>
				</tr>
				<tr>
					<td colspan="2">
						<center>
							<input type="submit" value="Agregar">
						</center>
					</td>
				</tr>
			</table>
		</fieldset>
	</form>
</div>
<hr>
<section id="dt_example">
	<div id="container">
		<table border="1" class="display" id="example_responsable">
			<thead>
				<tr>
					<th>#</th>
					<th>NOMBRES</th>
					<th>APELLIDOS</th>
					<th>CORREO</th>
					<th>TEL&Eacute;FONO</th>
					<th>EDITAR</th>
					<th>ELIMINAR</th>
				</tr>
			</thead>
			<tbody>
            <?php
												$n = 0;
												foreach ( $responsable as $r ) {
													$n += 1;
													?>
            <tr>
					<td><?php echo $n ?></td>
					<td><?php echo $r->nombres ?></td>
					<td><?php echo $r->apellidos ?></td>
					<td><?php echo $r->correo ?></td>
					<td><?php echo $r->telefono ?></td>
					<td class="center"><a
						href="<? echo base_url();?>index.php/responsable/accion?id=<?=$r-> id_solicitud_responsable?>">
							<img src="<? echo base_url();?>images/editar.png" width="20"
							height="20" />
					</a></td>
					<td class="center"><a
						onclick="return confirm('¿Esta seguro que desea eliminar responsable?')"
						href="<? echo base_url();?>index.php/responsable/eliminar?id=<?=$r-> id_solicitud_responsable?>">
							<img src="<? echo base_url();?>images/eliminar.png" width="20"
							height="20" />
					</a></td>
				</tr>
            <?php
												}
												?>
            </tbody>
		</table>
	</div>
</section>
<center>
	<input type="button"
		onclick="location.href='<?php echo base_url() . 'index.php/proveedor/solicitud/' . $idSolUsuario ?>'"
		value="Terminar" />
</center>
<br />
<?php $this->load->view('footer'); ?>